<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>传智健康</title>
    <link rel="stylesheet" href="../css/page-health-index.css"/>
    <link rel="stylesheet" href="../css/page-health-login.css"/>
    <link rel="stylesheet" href="../plugins/elementui/index.css"/>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">预约记录</span>
        <span class="f-right"><a href="/pages/index.html"><font color="white">回到首页</font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="icon-more"><a href="/logout"><font color="white">退出</font></a></i></span>
    </div>

    <span>开始日期</span>
    <el-date-picker
            v-model="value1"
            type="date"
            placeholder="选择日期">
    </el-date-picker>
    <br>
    <span>结束日期</span>
    <el-date-picker
            v-model="value2"
            type="date"
            placeholder="选择日期">
    </el-date-picker>
    <br>
    <button @click="findRecord">查询</button>


    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="list-column2">
            <!--***************-->
            <ul class="list">
                <li class="list-item" v-for="record in recordList">
                    <a class="link-page" :href="'record_detail.html?id='+record.id">
                        <img class="img-object f-left" :src="'http://qvg9clowq.hd-bkt.clouddn.com/'+ record.img" alt="">
                        <div class="item-body">
                            <h4 class="ellipsis item-title">体检人:{{record.memberName}}</h4>
                            <p class="ellipsis-more item-desc">预约套餐:{{record.setmealName}}</p>
                            <span style="font-size: 10px">点击查看预约详情查看</span>
                        </div>
                    </a>
                </li>
            </ul>

            <!--******************-->
            <!--<ul class="list" v-for="record in recordList">-->
                <!--<li class="type-item" style="width: 100%">-->
                    <!--<a class="link-page" :href="'record_detail.html?id='+record.id">-->
                        <!--<div class="type-title">-->
                            <!--<div style="float: left; width: 30%; height: 50px">-->
                                <!--<img class="img-object f-left" height="100px" width="50px"-->
                                     <!--:src="'http://qvg9clowq.hd-bkt.clouddn.com/'+ record.img"-->
                                     <!--alt="">-->
                            <!--</div>-->
                            <!--<h3>&nbsp;&nbsp;体检人:{{record.memberName}}</h3>-->
                            <!--<h4>&nbsp;&nbsp;预约套餐:{{record.setmealName}}</h4>-->
                            <!--<div style="float: left;width: 50px"></div>-->
                            <!--<span style="font-size: 10px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                                <!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                                <!--点击查看预约详情查看</span>-->
                        <!--</div>-->
                    <!--</a>-->
                <!--</li>-->
            <!--</ul>-->
            <!--*************-->


        </div>
    </div>


</div>
</body>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            recordList: [
            //     {
            //     id: '2',
            //     MemberName: '崔',
            //     setmealName: 'a套餐',
            //     img: '2841946b-81d4-4e2c-9a6e-dc91553b0cd9.jpg'
            // }, {
            //     id: '8',
            //     MemberName: '善',
            //     setmealName: 'b套餐'
            // }
            ],
            value1: '',
            value2: '',

        },
        methods: {
            findRecord() {
                console.log(this.value1.toString());
                console.log(this.value1);
                if (this.value1 === '' || this.value2 === '') {
                    this.$message.error("未选择日期")
                    return false;
                }
                let year1 = this.value1.getFullYear();
                let month1 = this.value1.getMonth() + 1;
                let day1 = this.value1.getDate();
                date1 = '' + year1 + '-' + month1 + '-' + day1;
                let year2 = this.value2.getFullYear();
                let month2 = this.value2.getMonth() + 1;
                let day2 = this.value2.getDate();
                date2 = '' + year2 + '-' + month2 + '-' + day2;
                axios.get("/order/getAllSetmealByMid.do?fistDate=" + date1 + "&lastDate=" + date2).then((res) => {
                    if (res.data.flag) {
                        this.recordList = res.data.data;
                    } else {
                        this.$message.error(res.data.message);
                    }
                });
            }
        },
        mounted() {
            axios.get("/order/getAllSetmealByMid.do?fistDate=-1" + this.value1 + "&lastDate=-1" + this.value2).then((res) => {
                if (res.data.flag) {
                    this.recordList = res.data.data;
                } else {
                    this.$message.error(res.data.message);
                }
            });
        }
    });
</script>

</html>